/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.edu.uniminuto.arqSw.videominuto.DAO;

import co.edu.uniminuto.arqSw.videominuto.Hibernate.Cliente;
import co.edu.uniminuto.arqSw.videominuto.Hibernate.HibernateUtil;
import co.edu.uniminuto.arqSw.videominuto.Hibernate.Serie;
import java.util.List;
import org.hibernate.Query;
import org.hibernate.Transaction;
import org.hibernate.classic.Session;

/**
 *
 * @author JULIAN
 */
public class ListadoSeriesDAO {
   Session session = null;
   List <Serie>miLista = null;
    public ListadoSeriesDAO() {
    this.session = HibernateUtil.getSessionFactory().openSession();                
                              }
    public List getListado(){
    try{
    
    
    Transaction tx = session.beginTransaction();
    tx.begin();
    Query q= session.createQuery("from Serie");
    
     miLista =(List<Serie>)q.list();
tx.commit();
}catch(Exception e){
e.printStackTrace();
}
    
    return miLista;
    }
}
